<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddFilesToEdutopics extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('edu_topics', function (Blueprint $table) {
            //这个迁移文件是在数据表已经创建完成,网站已经上线运行之后需要往数据表中新增字段的时候使用这个数据迁移文件
            $table->unsignedInteger('comment_num')->default(0)->comment('存放帖子的评论数量');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('edu_topics', function (Blueprint $table) {
            //
        });
    }
}
